// 老师、教职工上班签到纪录
class TeacherAttendance {

    School school 
    Teacher teacher  
    Boolean attendance = false// 是否准时到校，上班
    Boolean leave// 是否请假 
    Date attendanceTime  = new Date()
 

    static constraints = { 
        school( blank: false); 
        teacher( blank: false);         
        attendance()
        leave()
    }

    static mapping = {
       table 'xedu_teacherattendance'
       leave column:'isleave' 
    }

    String toString() { 
        "${teacher}于${startTime.format('yyyy年MM月dd日 HH点mm分')}${attendance?'准时到校。':'迟到。'}"
    }
}
